# $Id: PKGBUILD 82713 2013-01-23 11:06:02Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Roman Kyrylych <Roman.Kyrylycg@gmail.com>
# Contributor: Darwin Bautista <djclue917@gmail.com>

pkgname=font-mathematica
pkgver=9.0
pkgrel=2
pkgdesc="Mathematica fonts by Wolfram Research, Inc."
arch=('any')
url="http://support.wolfram.com/mathematica/systems/windows/general/latestfonts.html"
depends=('fontconfig' 'xorg-font-utils')
makedepends=('unzip')
conflicts=('ttf-mathematica')
replaces=('ttf-mathematica')
install=font.install
license=('custom')
source=($pkgname-$pkgver.tar.gz::http://support.wolfram.com/kb/data/uploads/2012/11/Fonts.tar.gz
	license.txt)
md5sums=('59220bcb9360e3b6886406cb66d750d8'
         '4d95629d78541826cb543764c8025c0b')

build() {
  cd $srcdir/Fonts/
  # Install TrueType fonts
  mkdir -p $pkgdir/usr/share/fonts/TTF
  install -m644 TTF/*.ttf $pkgdir/usr/share/fonts/TTF/
  # Install Type1 fonts
  mkdir -p $pkgdir/usr/share/fonts/Type1
  install -m644 Type1/*.pfa $pkgdir/usr/share/fonts/Type1/

  # Remove unnecessary Type1 fonts
  rm $pkgdir/usr/share/fonts/Type1/{UT*,cour*,c06*}
  # Remove TTF
  rm $pkgdir/usr/share/fonts/TTF/Vera.ttf
  rm $pkgdir/usr/share/fonts/TTF/VeraBI.ttf
  rm $pkgdir/usr/share/fonts/TTF/VeraBd.ttf
  rm $pkgdir/usr/share/fonts/TTF/VeraIt.ttf
  rm $pkgdir/usr/share/fonts/TTF/VeraMoBI.ttf
  rm $pkgdir/usr/share/fonts/TTF/VeraMoBd.ttf
  rm $pkgdir/usr/share/fonts/TTF/VeraMoIt.ttf
  rm $pkgdir/usr/share/fonts/TTF/VeraMono.ttf
  rm $pkgdir/usr/share/fonts/TTF/VeraSe.ttf
  rm $pkgdir/usr/share/fonts/TTF/VeraSeBd.ttf
  # Remove SVG files
  rm -rf $pkgdir/usr/share/fonts/SVG
  # Install license
  install -D -m644 $srcdir/license.txt $pkgdir/usr/share/licenses/${pkgname}/license.txt
}
